﻿using Sunboxsoft.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Entity = Sunboxsoft.ASMS.Server.Domain.Entity;
using Service = Sunboxsoft.ASMS.Server.Domain.Service;

namespace Sunboxsoft.ASMS.Web.ApiControllers
{
    public class UpdateController : ApiController
    {
        [HttpPost]
        public ServiceResult Package(UpdatePackageParams @params)
        {
            return new Service.UpdateService().UpdatePackage(@params.Id,
                @params.Package,
                @params.ItemArray,
                @params.PriceArray, null);
        }

        public class UpdatePackageParams
        {
            public Guid Id { get; set; }
            public Entity.EPackage Package { get; set; }
            public Entity.EPackageItem[] ItemArray { get; set; }
            public Entity.ESalesPrice[] PriceArray { get; set; }
        }
    }
}
